package social.hub.linkedin;

import java.util.Calendar;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
		"year",
		"month",
		"day"
})
@XmlRootElement(name = "date")
public class Date {

	@XmlElement(required = true, type = String.class)
	@XmlJavaTypeAdapter(Adapter1.class)
	protected Long	year;
	@XmlElement(required = true, type = String.class)
	@XmlJavaTypeAdapter(Adapter1.class)
	protected Long	month;
	@XmlElement(required = true, type = String.class)
	@XmlJavaTypeAdapter(Adapter1.class)
	protected Long	day;

	public Long getYear() {
		return year;
	}

	public void setYear(Long value) {
		this.year = value;
	}

	public Long getMonth() {
		return month;
	}

	public void setMonth(Long value) {
		this.month = value;
	}

	public Long getDay() {
		return day;
	}

	public void setDay(Long value) {
		this.day = value;
	}

	public java.util.Date getDate() {
		Calendar calendar = Calendar.getInstance();
		calendar.set(year.intValue(), month.intValue(), day.intValue());
		return calendar.getTime();
	}

	public String toString() {
		return this.getDay().toString() + '/' 
				+ this.getMonth().toString() + '/' 
				+ this.getYear().toString();
	}
}